package com.masz.seatathree.service;

import com.masz.seatathree.dao.mapper.TbSeata;
import com.masz.seatathree.dao.mapper.TbSeataMapper;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author masz
 * @Date 2022/2/12 14:08
 */
@Service
public class SeataThreeService {

    @Autowired
    TbSeataMapper mapper;

    @GlobalTransactional(rollbackFor = Exception.class)
    public void test(String v){
        TbSeata s = new TbSeata();
        s.setV(v);
        mapper.insert(s);
//        int i=1/0;
    }

}
